// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        wind_num: 1,

        wind_label: {
            default: null,
            type: cc.Label,
            tooltip: "风力描述label"
        }
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {

        globalThis.WeatherManager = this;


    },

    start() {

    },

    update(dt) {

        this.wind_label.string = "风力: " + this.wind_num;


    },


    on_change_wind: function (slider, customEventData) {

        this.wind_num = slider.progress * 10 - 5;

    }
});
